package com.haoshuang.zhouzhoubang.ui.adapter

import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemPushBinding
import com.haoshuang.zhouzhoubang.model.bean.TsBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.gone
import com.mufeng.libs.utils.view.visible


/**
 * 订单模块中的订单列表适配器
 * */
class PushAdapter(data: MutableList<TsBean>) :
    BaseBindingQuickAdapter<TsBean, ItemPushBinding>(data){
    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: TsBean?) {
        val binding = ItemPushBinding.bind(holder.itemView)
        binding.apply {
            tvName.text=item?.store_name
            tvTime.text=item?.add_time
            tvAdr.text=item?.user_address
            if (item?.is_platform==1){
                tvJd.visible()
            }else{
                tvJd.gone()
            }
            //1套餐2门店3个人
            when(item?.show_status){
                1->{ tvTd.text="订单类型：套餐订单"}
                2->{tvTd.text="订单类型：门店订单"}
                3->{tvTd.text="订单类型：个人订单"}
            }


        }

    }

}